<form action="index.php?app=ectools&ctl=admin_messenger_config&act=saveUseSetting" method="post" class="tableform" id='messengerconfig'>
    <div id="x-g-basic" class="division">
        <{if $smsList}>
        <table width="100%" cellspacing="0" cellpadding="0" border="0" id="EConfig">
            <{foreach from=$smsType item=item key=key}>
            <tr>
                <th><{t}><{$item}>：<{/t}></th>
                <{foreach from=$smsList item=sms key=index}>
                <td>
                  <input type="radio" <{if $smsUse[$key] == $sms.app_key}>checked="checked"<{/if}> value="<{$sms.app_key}>" name="<{$key}>"><{$sms.sms_name}> &nbsp;&nbsp;
                </td>
                <{/foreach}>
            </tr>
            <{/foreach}>
        </table>
        <{else}>
            <div style="text-align:center">尚未配置短信平台</div>
        <{/if}>
    </div>
    <div class="table-action"><{button id="config" label=$___desktop="保存"|t:'desktop' type="button"}></div>
</form>
<script>
    (function() {
        var _form = $('messengerconfig');
        var btn = $('config');
        _form.store('target', {
            onSuccess : function(response) {
                var hash_res_obj = JSON.decode(response);

                if (hash_res_obj.success != undefined && hash_res_obj.success != "") {
                    try {
                        var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                    } catch (e) {}

                    if (_dialogIns) {
                        _dialogIns.close();
                    }
                }

            }
        });
        btn.addEvent('click', function() {
            _form.fireEvent('submit', {
                stop : $empty
            });
        });
    })();
</script>